package com.wn.consumer.demo06;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2022 -11-03
 * @desc
 */
//@Component
//@Slf4j
public class DeadConsumer {


    /**
     * 消费死信队列中的消息
     * 1、@Exchange 和   拒绝消息的队列中绑定的 交换机名称一致
     * 2、key 和   拒绝消息的队列中绑定的 路由一致
     *
     * @param msg
     */
//    @RabbitListener(
//            bindings = @QueueBinding(
//                    value = @Queue("dead-queue"),
//                    exchange = @Exchange(name = "exchange-dlx",type = ExchangeTypes.DIRECT),
//                    key = "dlx.ooo"
//            )
//    )
//    public void handlerMsg(String msg){
//        log.info("死信队列中消费消息:{}",msg);
//    }

}
